import './Flag.scss'
import React from 'react'

interface FlagProps extends React.PropsWithoutRef<JSX.IntrinsicElements['svg']> {
    engaged?: boolean
    animated?: boolean
}

export function Flag({ engaged, animated, ...props }: FlagProps): JSX.Element {
    return engaged ? (
        <svg
            className={`posthog-toolbar-icon-flag${animated ? ' animated' : ''}`}
            width="40"
            height="50"
            viewBox="0 0 40 50"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
            {...props}
        >
            <path
                className="color1"
                d="M16.1252 7.51476L22.9475 7.60607L31.2672 6.48863C31.2672 6.48863 32.6643 6.24008 33.4094 6.67454C34.1545 7.10947 35.2461 13.8975 36.132 17.2913C36.911 20.276 38.2148 22.5702 39.048 25.5403C39.1619 25.947 39.2767 27.1323 38.0967 27.3187C37.2343 27.4547 34.3668 27.321 31.4541 27.852C30.3828 28.0469 27.2404 28.9501 26.3004 29.1191C22.8049 29.747 21.7369 30.6404 18.6326 29.4298L17.7322 27.8463L17.7289 25.8157C16.6147 25.1148 13.9468 25.9287 12.2998 26.4493C10.6528 26.9704 9.43507 27.908 7.87799 28.6065C6.68146 24.6545 7.42564 26.4493 4.97328 16.702C2.67107 7.55007 1.75179 8.77107 1.58092 4.64535C1.55362 3.99248 3.10929 3.28926 4.76098 2.73665C6.41268 2.18357 8.15994 1.78159 8.51579 1.73169C11.325 1.33583 13.0882 1.42855 14.2193 2.297C15.3499 3.16545 15.8479 4.80916 16.1252 7.51476Z"
                fill="#70AA54"
            />
            <path
                d="M0.815899 0.21889C1.33979 0.113923 1.85662 0.421282 1.97053 0.905164L13.0377 47.9849C13.1516 48.4692 12.8188 48.947 12.2949 49.0524C11.771 49.1574 11.2542 48.85 11.1403 48.3662L0.073128 1.28645C-0.0407821 0.802094 0.292006 0.324327 0.815899 0.21889Z"
                fill="#2F4823"
            />
            <path
                className="color2"
                d="M2.43759 3.93929L5.17285 15.0272L8.40751 28.2092C8.98648 27.8595 8.40846 28.213 8.40846 28.213C8.40846 28.213 9.78479 27.9838 9.6737 27.3248L8.97377 24.7157C8.45835 21.657 7.92035 17.4621 7.17381 13.2357C6.47858 9.30013 4.50774 6.04944 3.52068 3.15274L3.48444 3.04589C2.87676 3.30148 3.85252 3.16451 3.48396 3.04448C3.1154 2.92445 2.28461 3.30714 2.43759 3.93929Z"
                fill="#527940"
            />
            <path
                className="color2"
                d="M19.6432 28.1181L19.5231 24.7898L18.0583 16.5337C17.5302 12.672 16.9955 8.81131 16.433 4.95438C16.3445 4.34576 15.7844 2.76185 15.2431 2.36269C14.7022 1.96354 13.5099 1.72865 13.1254 1.4707C13.2539 2.04402 12.8985 2.25959 13.0275 2.92846C13.1254 3.43259 14.2141 3.828 14.5459 4.29917C14.7563 4.5976 13.4468 5.38789 13.9434 6.16173C14.0668 6.35378 15.4949 6.8452 15.1677 7.54043C15.0392 7.81343 14.8914 8.44089 14.7705 9.11399C14.6236 9.93066 15.5269 10.0935 15.541 10.4936C15.5565 10.9464 14.9903 11.9608 14.9724 12.4381C14.955 12.905 15.5198 13.7081 15.517 14.158C15.5151 14.488 14.6311 14.7327 14.6156 15.6742C14.6081 16.1369 16.1774 16.6495 16.3906 17.308C16.6114 17.9905 15.4807 18.8236 15.7632 19.5641C15.9246 19.9886 16.9526 20.2414 17.18 20.69C17.5368 21.3941 16.617 22.739 16.8058 23.5316C16.8646 23.7797 17.8065 23.5161 17.935 23.75C18.1134 24.0748 17.2416 25.4841 17.606 25.5217C19.719 25.742 19.4987 27.0134 19.6432 28.1181Z"
                fill="#527940"
            />
            <path
                className="color2"
                d="M39.2666 25.6895L36.7977 18.1051C36.0295 14.9368 35.2566 11.7699 34.4654 8.60915C34.3402 8.1102 33.7885 6.80683 33.3733 6.53241C32.9577 6.25752 32.2197 6.14172 32.158 6.44815C32.0959 6.75458 32.8151 7.90827 33.0938 8.26601C33.2703 8.49241 32.4484 9.29448 32.8725 9.88709C32.9775 10.034 34.0154 10.29 33.8619 10.9062C33.8017 11.1481 33.765 11.688 33.7518 12.2637C33.7358 12.9617 34.3764 12.9999 34.4282 13.3322C34.4861 13.7092 34.2013 14.6177 34.239 15.0182C34.2757 15.4103 34.7492 16.0199 34.7944 16.396C34.8278 16.6718 34.2432 16.9721 34.3308 17.7601C34.3741 18.1475 35.5108 18.4054 35.7269 18.9326C35.9509 19.4786 35.2571 20.2972 35.5296 20.8851C35.6854 21.2221 36.4216 21.3224 36.6254 21.6721C36.9455 22.2219 36.4508 23.4448 36.664 24.0868C36.7309 24.2873 37.3536 23.9649 37.4666 24.1466C37.6233 24.3984 37.62 27.1746 37.8751 27.1671C39.3574 27.1224 39.2666 25.6895 39.2666 25.6895Z"
                fill="#527940"
            />
            <path
                className="color2"
                d="M16.4722 7.498C16.426 9.1257 17.2083 11.1992 17.4009 12.8132C17.9281 17.2392 18.4783 21.6026 19.0907 26.0254C19.1411 26.3883 19.3886 27.1367 19.255 27.7741C19.0775 28.6199 18.1107 29.181 18.6374 29.4276C19.5638 29.8602 25.6363 30.3704 26.0322 28.5902C26.2567 27.5806 25.6344 27.1536 25.2964 26.1581C24.7584 24.5747 24.6615 22.6895 24.493 21.0529C24.1187 17.4237 26.0486 11.3248 23.7055 7.96308C23.1783 7.20618 22.3696 7.40482 19.6974 7.31209C18.2227 7.26079 17.2408 7.24243 16.7946 7.19583C16.4468 7.15911 16.4863 6.99576 16.4722 7.498Z"
                fill="#527940"
            />
            <path
                className="color3"
                d="M18.1311 7.57242L24.3425 29.2295C24.431 29.5298 23.5357 30.0678 23.2232 30.049L22.3378 30.097C21.813 30.1252 20.9619 30.1271 20.4371 30.1008L19.9118 30.0744C19.5997 30.0556 18.7581 29.7482 18.6075 29.3467C18.4568 28.9452 19.3559 28.4825 19.4604 27.4902C19.5606 26.5371 18.9337 26.9136 19.1092 25.96C19.1092 25.96 19.217 26.8228 19.113 25.9524C19.009 25.0821 19.419 24.8293 19.3493 24.3732L16.7764 7.54749C16.7327 7.23729 17.0047 7.48251 17.3173 7.49569L17.3893 7.49853C17.7018 7.51171 18.0426 7.27211 18.1311 7.57242Z"
                fill="#415E32"
            />
        </svg>
    ) : (
        <svg width="40" height="50" viewBox="0 0 40 50" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
            <path
                d="M39.8016 26.16L37.3327 18.5756C36.5645 15.4073 35.7916 12.2404 35.0004 9.07965C34.8756 8.5807 34.3235 7.27732 33.9084 7.00243C33.4932 6.72801 32.7547 6.61222 32.693 6.91865C32.6309 7.22508 33.3501 8.37877 33.6288 8.7365C33.8053 8.96291 32.9834 9.765 33.4075 10.3576C33.5125 10.5045 34.5504 10.7605 34.397 11.3767C34.3367 11.6186 34.3005 12.1585 34.2868 12.7337C34.2708 13.4322 34.9114 13.4704 34.9632 13.8027C35.0216 14.1792 34.7363 15.0882 34.774 15.4888C34.8107 15.8808 35.2842 16.4899 35.3294 16.8665C35.3628 17.1423 34.7782 17.4426 34.8658 18.2306C34.9091 18.618 36.0463 18.8759 36.2619 19.4031C36.4859 19.9491 35.7921 20.7677 36.0647 21.3556C36.2205 21.6926 36.9566 21.7929 37.1604 22.1426C37.4805 22.6924 36.9858 23.9153 37.199 24.5568C37.2659 24.7578 37.8886 24.4354 38.0016 24.6171C38.1583 24.8689 38.155 27.6451 38.4106 27.6376C39.8924 27.5929 39.8016 26.16 39.8016 26.16Z"
                fill="#71AA55"
            />
            <path
                d="M16.7521 7.77182L23.5745 7.86313L31.8942 6.74569C31.8942 6.74569 33.2912 6.49716 34.0359 6.93209C34.781 7.36655 35.873 14.1546 36.7584 17.5483C37.5374 20.5331 38.8417 22.8277 39.6749 25.7974C39.7888 26.2041 39.9032 27.3898 38.7236 27.5757C37.8613 27.7122 34.9937 27.5781 32.081 28.109C31.0097 28.3044 27.8673 29.2076 26.9273 29.3766C23.4319 30.0045 22.3638 30.8975 19.2595 29.6868L18.3591 28.1038L18.3558 26.0732C17.2416 25.3719 14.5732 26.1862 12.9267 26.7068C11.2797 27.2274 10.0615 28.165 8.50492 28.8636C7.30839 24.9115 8.05258 26.7068 5.60022 16.959C3.29754 7.80713 2.37825 9.02811 2.20786 4.90287C2.18056 4.24954 3.73624 3.54632 5.38793 2.99372C7.03916 2.44111 8.78688 2.03913 9.14273 1.98876C11.9519 1.5929 13.7151 1.68609 14.8458 2.55407C15.9764 3.42252 16.4744 5.06622 16.7521 7.77182Z"
                fill="#93D673"
            />
            <path
                d="M1.35076 0.68937C1.87466 0.584403 2.39147 0.891305 2.50539 1.37566L13.5726 48.4554C13.6865 48.9397 13.3537 49.4175 12.8303 49.5225C12.3064 49.6279 11.7891 49.3205 11.6752 48.8362L0.607991 1.75693C0.494551 1.27257 0.826869 0.794807 1.35076 0.68937Z"
                fill="#415F32"
            />
            <path
                d="M2.97627 4.40975L5.71153 15.4976L8.94621 28.6797C9.52517 28.3295 8.94716 28.683 8.94716 28.683C8.94716 28.683 10.3235 28.4542 10.2124 27.7952L9.51247 25.1861C8.99705 22.1275 8.45903 17.9326 7.71249 13.7061C7.01774 9.77059 5.04644 6.5199 4.05937 3.62319L4.02312 3.51635C3.41544 3.77194 4.39122 3.63497 4.02266 3.51494C3.6541 3.39491 2.8233 3.77759 2.97627 4.40975Z"
                fill="#71AA55"
            />
            <path
                d="M20.1779 28.5886L20.0579 25.2603L18.5931 17.0036C18.0649 13.1425 17.5302 9.28176 16.9677 5.42482C16.8793 4.8162 16.3191 3.2323 15.7778 2.83314C15.237 2.43398 14.0447 2.19911 13.6601 1.94116C13.7886 2.51448 13.4332 2.73007 13.5627 3.39894C13.6601 3.90306 14.7488 4.29844 15.0807 4.76962C15.2911 5.06804 13.9816 5.85834 14.4782 6.63218C14.6015 6.82375 16.0301 7.31565 15.7025 8.01087C15.574 8.28388 15.4262 8.91134 15.3052 9.58444C15.1584 10.4011 16.0616 10.564 16.0757 10.9641C16.0913 11.4169 15.525 12.4313 15.5071 12.9086C15.4897 13.3755 16.0546 14.178 16.0517 14.6285C16.0499 14.9585 15.1659 15.2032 15.1503 16.1446C15.1428 16.6073 16.7121 17.1199 16.9254 17.7785C17.1461 18.4605 16.0155 19.2941 16.2979 20.0345C16.4594 20.4591 17.4874 20.7119 17.7147 21.1605C18.0715 21.8646 17.1518 23.2094 17.3405 24.0021C17.3998 24.2501 18.3412 23.9861 18.4697 24.2205C18.6481 24.5453 17.7764 25.9545 18.1407 25.9922C20.2537 26.2125 20.0334 27.4839 20.1779 28.5886Z"
                fill="#71AA55"
            />
            <path
                d="M17.0072 7.96846C16.9611 9.59616 17.7438 11.6696 17.9359 13.2836C18.4631 17.7092 19.0133 22.0731 19.6257 26.4958C19.6761 26.8582 19.9237 27.6071 19.79 28.2445C19.6125 29.0903 18.6457 29.6514 19.1729 29.8976C20.0988 30.3306 26.1713 30.8404 26.5672 29.0607C26.7917 28.051 26.1694 27.6241 25.8315 26.6286C25.2939 25.0451 25.1969 23.1599 25.028 21.5233C24.6538 17.8937 26.5836 11.7953 24.2405 8.43351C23.7133 7.67662 22.9046 7.87526 20.2324 7.78253C18.7577 7.73122 17.7758 7.71286 17.3296 7.66626C16.9818 7.62954 17.0218 7.46622 17.0072 7.96846Z"
                fill="#71AA55"
            />
            <path
                d="M18.6698 8.043L24.8812 29.7001C24.9697 30.0004 24.0744 30.5384 23.7619 30.5196L22.8765 30.5676C22.3516 30.5958 21.5011 30.5977 20.9762 30.5713L20.4509 30.5445C20.1384 30.5262 19.2968 30.2188 19.1461 29.8173C18.996 29.4158 19.8946 28.9531 19.9991 27.9608C20.0993 27.0076 19.4723 27.3837 19.6479 26.4306C19.6479 26.4306 19.7557 27.2934 19.6517 26.423C19.5477 25.5527 19.9576 25.2999 19.888 24.8434L17.3151 8.01757C17.2713 7.70785 17.5434 7.95311 17.8559 7.96629L17.928 7.9691C18.2405 7.98228 18.5813 7.74269 18.6698 8.043Z"
                fill="#629948"
            />
        </svg>
    )
}
